#include "complex.h"

Complex::Complex()   // constructor implicit definit in complex.h
{
(*this).real=1.0;   //sau se mai poate scrie this->real=1.0;  
(*this).imag=1.0;   }

Complex::Complex(double real,double imag){
(*this).real=real;
(*this).imag=imag;
}

Complex Complex::operator+(Complex z){  //primeste ca parametru un numar complex, returneaza alt numar complex
double real;
double imag;

real=(*this).real+z.getReal();
imag=(*this).imag+z.getImag();
Complex s=Complex(real,imag);
return s; 
}

double Complex::getReal() {
double real;
real=(*this).real;
return real;  }

double Complex::getImag()  {
double imag;
imag=(*this).imag;
return imag;  }

void Complex::setReal(double real)  {
(*this).real=real;  }

void Complex::setImag(double Imag)  {
(*this).imag=imag;  }
